You are here: Symbol Reference > Dew Namespace > Dew.Stats Namespace > Dew.Stats.Units Namespace > Classes > Statistics Class > Statistics Methods > NormalFit Method > Statistics.NormalFit Method ([In] TVec, out double, out double, double[], double[], double)
Dew Stats for .NET
ContentsIndexHome
PreviousUpNext
Statistics.NormalFit Method ([In] TVec, out double, out double, double[], double[], double)

Calculate parameters for normally distributed values.

Syntax
C#
Visual Basic
public static void NormalFit([In] TVec X, out double mu, out double sigma, ref double[] PCIMu, ref double[] PCISigma, double Alpha);
Parameters 
Description 
[In] TVec X 
Stores data which is assumed to be normaly distributed. 
out double mu 
Return normal distribution parameter estimator Mu. 
out double sigma 
Return normal distribution parameter estimator Sigma. 
ref double[] PCIMu 
Mu (1-Alpha)*100 percent confidence interval. 
ref double[] PCISigma 
Sigma (1-Alpha)*100 percent confidence interval. 
double Alpha 
Confidence interval percentage. 

RandomNormal, NormalStat

The following example generates 100 random standard normally distributed values and then uses NormalFit routine to extract used Mu and Sigma parameters

using Dew.Math; using Dew.Stats; using Dew.Stats.Units; namespace Dew.Examples; { private void Example() { Vector vec1 = new Vector(0); // first, generate 1000 normaly distributed // numbers with Mu a=0.0 and Sigma =1.0 vec1.Size(1000, false); StatRandom.RandomNormal(0.0, 1.0, vec1, -1); double resMu, resSigma; double[] CIMu = new double[2]; double[] CISigma = new double[2]; // Now extract the Mu,Sigma and their 95% confidence intervals. // Use at max 400 iterations and tolerance 0.0001 Statistics.NormalFit(vec1, out resMu, out resSigma, out CIMu, out CISigma, 0.05); } }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!